package com.imc.platform.base.common.controller;
import com.imc.platform.base.common.service.ISwitchService;
import com.twp.common.tuple.ResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/*
* 类描述：开关状态通用控制器处理类
* 开发者：YT
* 创建日期：2018/10/27 22:12
*/
@Slf4j
@Controller
@RequestMapping("base/switch")
public class SwitchController {
    @Autowired
    ISwitchService switchService;

    /**
     * QY 2018/9/3 10:16
     * 方法描述：更改状态
     **/
    @RequestMapping(value = "/updateState", method = RequestMethod.POST)
    @ResponseBody
    public ResultDTO updateState(@RequestParam String state, @RequestParam String id, @RequestParam String tablename) {
        return ResultDTO.builder()
                .data(switchService.updateState(state, id, tablename))
                .build();
    }

}